Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update target and compile sdk version to v29 #12947

Merged
merged 11 commits into from
Sep 24, 2020
Merged

Conversation

malinajirka
Copy link
Contributor

@malinajirka malinajirka commented Sep 14, 2020

This PR updates compile and target sdk version to v29. I checked official android docs, but I haven't found any breaking change which would affect our app - privacy changes and behavior changes.

  • Updates some parts of our code since the nullable/nonnullable annotations were added to some of the java classes in the SDK.
  • Suppresses "Field requires API level 29: in MediaStore.MediaColumns" warning. The fields we use were just moved to a super class in the SDK - the constants remain the same.
  • Updates gutenberg-mobile reference - corresponding PRs - gutenberg-mobile, gutenberg

Not ready for merge - related prs in gutenberg repos need to be merged first and the ref needs to be updated

I think the lint is still failing since the changes in gutenberg repo are in a fork - when I targeted the submodule to the fork locally the lint passed without issues.

To test:
Test the app - anything you can think of. Ideally spent at least 10 minutes testing various flows.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Sep 14, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Sep 14, 2020

You can test the changes on this Pull Request by downloading the APK here.

@malinajirka malinajirka marked this pull request as draft September 15, 2020 07:50
@peril-wordpress-mobile
Copy link

Messages
📖

This PR contains changes in the subtree libs/utils/. It is your responsibility to ensure these changes are merged back into wordpress-mobile/WordPress-Utils-Android. Follow these handy steps!
WARNING: Make sure your git version is 2.19.x or lower - there is currently a bug in later versions that will corrupt the subtree history!

  1. cd WordPress-Android
  2. git checkout update-target-sdk-to-29
  3. git subtree push --prefix=libs/utils/ https://github.com/wordpress-mobile/WordPress-Utils-Android.git merge/WordPress-Android/12947
  4. Browse to https://github.com/wordpress-mobile/WordPress-Utils-Android/pull/new/merge/WordPress-Android/12947 and open a new PR.

Generated by 🚫 dangerJS

@mchowning
Copy link
Contributor

I think the lint is still failing since the changes in gutenberg repo are in a fork - when I targeted the submodule to the fork locally the lint passed without issues.

The lint error looks legitimate to me:

/home/circleci/project/libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java:374: Error: Field requires API level 29 (current min is 21): android.graphics.text.LineBreaker#JUSTIFICATION_MODE_INTER_WORD [InlinedApi]
view.setJustificationMode(LineBreaker.JUSTIFICATION_MODE_INTER_WORD);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/circleci/project/libs/gutenberg-mobile/gutenberg/packages/react-native-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java:379: Error: Field requires API level 29 (current min is 21): android.graphics.text.LineBreaker#JUSTIFICATION_MODE_NONE [InlinedApi]
view.setJustificationMode(LineBreaker.JUSTIFICATION_MODE_NONE);

I left a comment on the gutenberg PR about this.

@@ -29,4 +29,7 @@ private inline fun <reified T : Enum<T>> Intent.putEnumExtra(key: String, victim
private inline fun <reified T : Enum<T>> Intent.getEnumExtra(key: String, default: T): T =
getIntExtra(key, -1)
.takeUnless { it == -1 }
?.let { T::class.java.enumConstants[it] } ?: default
?.let {
@Suppress("UNNECESSARY_SAFE_CALL")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this @Suppress needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android studio complains when it's not there - I believe it's a false positive.
Screenshot 2020-09-23 at 11 37 40

Copy link
Contributor

@mchowning mchowning Sep 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly Android Studio doesn't seem to give me any warning if I remove the @Suppress line like you did in the screenshot. 🤔

Certainly makes sense to include the @Suppress since you're seeing the warning though. 👍

Copy link
Contributor

@mchowning mchowning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested a number of different flows and everything looks good to me.

⚠️ There is currently a crash when loading the block editor that is unrelated to this pr: p1600864334005800-slack-C6UJ0KRKQ. I expect that will be fixed soon and we just want to retest the block editor on this PR after the gutenberg-mobile submodule ref is updated to make sure we bring in the fix and not just the breakage (basically just make sure the block editor doesn't crash on load).

@malinajirka
Copy link
Contributor Author

I expect that will be fixed soon and we just want to retest the block editor on this PR after the gutenberg-mobile submodule ref is updated to make sure we bring in the fix and not just the breakage (basically just make sure the block editor doesn't crash on load).

The mentioned PR has been closed (not merged). A fix is included in wordpress-mobile/gutenberg-mobile#2662. We'll need to wait until this new PR gets merged.

@malinajirka
Copy link
Contributor Author

@mchowning I've updated the gutenberg-mobile submodule and merged develop into this branch. I've smoke tested the editor + some other parts of the app and all seems to work as expected. Can I just merge the PR when CI finishes or do you want to check the changes before the merge?

Thank you so much for all your help!!!!! 🙇 🙇 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants